home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / grn / gprint.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-12-04  |  1.9 KB  |  92 lines

  1. /*    gprint.h    1.1    84/10/08
  2.  *
  3.  * This file contains standard definitions used by the gprint program.
  4.  */
  5.  
  6. #include <stdio.h>
  7. #include <math.h>
  8.  
  9.  
  10. #define xorn(x,y)    (x)
  11.             /* was 512 */
  12. #define yorn(x,y)    (511 - (y))    /* switch direction for y-coordinates */
  13.  
  14. #define STYLES 6
  15. #define SIZES 4
  16. #define FONTS 4
  17. #define SOLID -1
  18. #define DOTTED 004    /* 014 */
  19. #define DASHED 020    /* 034 */
  20. #define DOTDASHED 024    /* 054 */
  21. #define LONGDASHED 074
  22.  
  23. #define TRUE    1
  24. #define FALSE    0
  25.  
  26. #define nullelt    -1
  27. #define nullpt    -1
  28. #define nullun    NULL
  29.  
  30. #define BOTLEFT    0
  31. #define BOTRIGHT 1
  32. #define CENTCENT 2
  33. #define VECTOR 3
  34. #define ARC 4
  35. #define CURVE 5
  36. #define POLYGON 6
  37. #define BSPLINE 7
  38. #define BEZIER 8
  39. #define TOPLEFT 10
  40. #define TOPCENT 11
  41. #define TOPRIGHT 12
  42. #define CENTLEFT 13
  43. #define CENTRIGHT 14
  44. #define BOTCENT 15
  45. #define TEXT(t) ( (t <= CENTCENT) || (t >= TOPLEFT) )
  46. /* WARNING * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING 
  47.  *    The above (TEXT) test is dependent on the relative values of the 
  48.  *    constants and will have to change if these values change or if new
  49.  *    commands are added with value greater than BOTCENT
  50.  */
  51.  
  52. #define NUSER 4
  53. #define NFONTS 4
  54. #define NBRUSHES 6
  55. #define NSIZES 4
  56. #define NJUSTS 9
  57. #define NSTIPPLES 8
  58.  
  59. #define ADD 1
  60. #define DELETE 2
  61. #define MOD 3
  62.  
  63. typedef struct point {
  64.     float x, y;
  65.     struct point *nextpt;
  66. } POINT;
  67.  
  68. typedef struct elmt {
  69.     int type, brushf, size, textlength;
  70.     char *textpt;
  71.     POINT *ptlist;
  72.     struct elmt *nextelt, *setnext;
  73. } ELT;
  74.  
  75. typedef struct unlt {
  76.     int action;
  77.     ELT *(*dbase), *oldelt, *newelt;
  78.     struct unlt *nextun;
  79. } UNELT;
  80.  
  81. typedef struct {
  82.     int tx_x;    /* First column of field */
  83.     int tx_y;    /* Row containing field */
  84.     int tx_size;    /* Size of field in characters */
  85. } TXFIELD;
  86.  
  87. #define DBNextElt(elt) (elt->nextelt)
  88. #define DBNextofSet(elt) (elt->setnext)
  89. #define DBNullelt(elt) (elt == NULL)
  90. #define Nullpoint(pt)  ((pt) == (POINT *) NULL)
  91. #define PTNextPoint(pt) (pt->nextpt)
  92.